package com.example.dyxeapplication.menu;

import com.example.dyxeapplication.R;
import com.example.dyxeapplication.menu.alfabet.Menu_Alfabet;
import com.example.dyxeapplication.menu.cerita.Menu_Cerita;
import com.example.dyxeapplication.menu.ejaan.Menu_Ejaan;
import com.example.dyxeapplication.menu.info.Menu_Info;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.view.View;

public class Menu extends Activity {
	private Button menu1, menu2, menu3;
	private Animation mAnimation;

	@Override
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.menu);

		menu1 = (Button) findViewById(R.id.iconmenuejaan);
		menu2 = (Button) findViewById(R.id.iconmenucerita);
		menu3 = (Button) findViewById(R.id.iconmenualfabet);
		mAnimation = AnimationUtils.loadAnimation(this,
				R.animator.animation_menu);

	}

	public void menualfabet(View v) {
		Intent myIntent = new Intent(this, Menu_Alfabet.class);
		myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(myIntent);
	}

	public void menuejaan(View v) {
		Intent myIntent = new Intent(this, Menu_Ejaan.class);
		myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(myIntent);
	}

	public void menucerita(View v) {
		Intent myIntent = new Intent(this, Menu_Cerita.class);
		myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(myIntent);
	}

	public void menuinfo(View v) {
		Intent myIntent = new Intent(this, Menu_Info.class);
		myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(myIntent);
	}

	public void onBackPressed() {
		System.exit(0);
	}

	@Override
	public void onResume() {
		super.onResume();
		menu1.startAnimation(mAnimation);
		menu2.startAnimation(mAnimation);
		menu3.startAnimation(mAnimation);
	}
}
